<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>215-将年月日替换成日月年.html</title>
</head>
<body>
	
</body>
<script>
	var str = "to day is 2019-05-29,is a good day";
	var reg = /(\d{4})-(\d{2})-(\d{2})/;
	console.log(str);
	console.log(str.replace(reg,"$2/$3/$1"));
</script>
</html>